package homework;

/**
 * @author green-citrus
 * @version 1.0
 */
public class Homework01 {
    public static void main(String[] args) {

    }
}

class Frock {
    //衣服出厂的序列号起始值
    private static int currentNum = 100000;
    private int serialNumber;

    public Frock() {
        serialNumber = getNextNum();
    }

    //生成上衣唯一序列号的方法
    public static int getNextNum(){
        currentNum += 100;
        return currentNum;
    }

    public int getSerialNumber() {
        return serialNumber;
    }
}

class TestFrock{
    public static void main(String[] args) {
        System.out.println(Frock.getNextNum());;//100100
        System.out.println(Frock.getNextNum());;//100200

        Frock frock1 = new Frock();
        Frock frock2 = new Frock();
        Frock frock3 = new Frock();
        System.out.println(frock1.getSerialNumber());//100300
        System.out.println(frock2.getSerialNumber());//100400
        System.out.println(frock3.getSerialNumber());//100500
    }
}
